<template>
    <div class='container container--sponsored'>
        <div class="region region--full">
            <section class="component component--module sponsored-content">
                <div class="column column--primary">
                    <div class="element element--sponsor" aria-hidden="true">
                        <header class="header header--secondary">
                            <h2 class="title">
                                <span class="label">Advertisement</span>
                            </h2>
                        </header>
                        <div class="dianomi_context">
                            <div class="wrapper">
                                <div class="sub-line2" style="width: auto;" v-if='index === 2'>
                                    <a href="">
                                        <img class="dianomi-lg" src="https://www.dianomi.com/img/dianomi-max-200x38.png"
                                            height="11" width="55" alt="Dianomi Logo">
                                    </a>
                                </div>
                                <div class='hero' v-for='(item, index) in adverData' :key='index'>
                                    <div class="subhero">
                                        <div class="heading_top"></div>
                                        <a rel="nofollow" class="dianomihref" href="">
                                            <img class="png" border="0" alt="Aramco" :srcset="item.src" :src="item.src">
                                            <div class="text">
                                                <div class="maintext">{{ item.title }}</div>
                                                <div style="display:inline" class="dianomi_provider_short">{{ item.cont }}
                                                </div>
                                            </div>
                                        </a>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="column column--aside" role="complementary" aria-label="Advertisement">
                    <div class="element element--sponsor">
                        <header class="header header--secondary">
                            <h2 class="title">
                                <span class="label">Advertisement</span>
                            </h2>
                        </header>
                        <div class="dianomi_context">
                            <div class="wrapper">
                                <div class="sub-line2" style="width: auto;">
                                    <a href="https://www.dianomi.com/whatsthis.pl?id=9828">
                                        <img class="dianomi-lg" src="https://www.dianomi.com/img/dianomi-max-200x38.png"
                                            height="11" width="55"></a>
                                </div>
                                <div class="hero rightHero" v-for='(item, index) in adverRightData' :key='index'>
                                    <div class="subhero">
                                        <div class="heading_top"></div>
                                        <a rel="nofollow" class="dianomihref" href="">
                                            <div class="text">
                                                <div class="dianomiHeading heading"></div>
                                                <span class="line2">Sponsored</span>
                                                <div class="maintext">{{ item.title }}</div>
                                                <div style="display:inline" class="dianomi_provider_short">{{ item.cont }}
                                                </div>
                                                <div class="action "></div>
                                            </div>
                                        </a>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </section>
        </div>
    </div>
</template>

<script setup>
import { useDataArrays } from '../../../api/data.js';
const { adverData, adverRightData } = useDataArrays();
</script>

<style scoped lang='scss'>
.wrapper {
    padding-left: 0;
    width: 100%;
    height: auto;
    overflow: auto;
    position: relative;
    text-align: left;
    margin-top: 0;
    background-color: #fff;
    padding: 0;
    display: table;
    position: relative;

    .heading_top,
    .heading {
        display: none;
    }

    .line2 {
        display: none;
    }

    .sub-line2 {
        bottom: 0;
        z-index: 999;
        top: auto;
        overflow: hidden;
        right: 5px;
        position: absolute;
        font-size: 10px;
        height: 1.3em;
        color: #424242;
        width: 55px;
        padding-bottom: 0;
        font-weight: 700;
        font-size: 9px;

        img {
            width: 55px;
            height: auto;
            border: none;
            outline: none;
            padding-left: 1px;
        }
    }

    .hero {
        width: 25%;
        background-position: 0 0;
        border: 0;
        box-sizing: border-box;
        margin-left: 0;
        color: #003876;
        position: relative;
        float: left;
        width: 23.5%;
        margin-bottom: 15px;
        margin-right: 2%;
        height: 100%;

        .subhero {
            padding-top: 0;
            display: block;
        }

        img {
            display: inline-block;
            float: none;
            padding-right: 0;
            width: 100%;
            object-fit: cover;
            height: 100px;
            padding-bottom: 0;
            position: relative;
            width: 100%;
            height: 180px;
            display: block;
            z-index: 0;
        }

        .text {
            z-index: 100;
            position: relative;
            padding: 5px 0;
            bottom: auto;
            width: 100%;
            max-width: 100%;
        }

        .maintext {
            font-size: 18px;
            line-height: 22px;
            display: inline;
            padding-right: 5px;
            padding: 0;
            display: block;
            color: #122225;
            font-weight: 700;
            margin-bottom: 5px;
        }

        .dianomi_provider_short {
            font-style: normal;
            font-family: lato, sans-serif;
            font-size: 15px;
            color: #999;
            font-weight: 400;
            display: block;
            letter-spacing: 0;
            margin-top: 0.3em;
            text-transform: none;
        }
    }

    .rightHero {
        width: 100%;
        height: 60px;
        padding-right: 0;

        .maintext {
            font-size: 14px;
        }
    }

    .rightHero:nth-child(2) {
        .text {
            padding-top: 0;
        }
    }

    .hero:last-child {
        margin-top: 0;
        padding: 0;
        margin-right: 0;
    }
}

@media screen and (min-width: 760px) {
    .hero img {
        height: 140px;
    }
}

@media screen and (max-width: 1295px) {
    .hero:first-child .text {
        padding-top: 5px;
    }

    .hero {
        width: 50%;
        height: 65px;
        padding-right: 1%;
    }
}
</style>